﻿using System;
using UnityEngine;

// Token: 0x020000A3 RID: 163
public class MaterialFade : MonoBehaviour
{
	// Token: 0x06000528 RID: 1320 RVA: 0x0001E79C File Offset: 0x0001C99C
	private void Start()
	{
		this.rends = base.GetComponentsInChildren<Renderer>();
	}

	// Token: 0x06000529 RID: 1321 RVA: 0x0001E7AC File Offset: 0x0001C9AC
	private void Update()
	{
		this.timer += Time.deltaTime;
		if (this.timer >= this.fadeStart)
		{
			float a = 1f - Mathf.InverseLerp(this.fadeStart, this.fadeEnd, this.timer);
			foreach (Renderer renderer in this.rends)
			{
				renderer.material.color = new Color(1f, 1f, 1f, a);
			}
		}
	}

	// Token: 0x0400041D RID: 1053
	public float fadeStart = 1f;

	// Token: 0x0400041E RID: 1054
	public float fadeEnd = 5f;

	// Token: 0x0400041F RID: 1055
	private float timer;

	// Token: 0x04000420 RID: 1056
	private Renderer[] rends;
}
